class PageList {
  /**
   *
   * @param {number} pageIndex 当前第几页
   * @param {number} totalCount 共多少条数据
   * @param {number} pageSize  每页显示多少
   * @param {[]} listData 查询的分页列表数据
   */
  constructor(pageIndex, totalCount, pageSize, listData) {
    this.pageIndex = pageIndex;
    this.totalCount = totalCount;
    this.pageCount = Math.ceil(totalCount / pageSize);
    this.listData = listData;
    this.pageStart = this.pageIndex - 3 > 0 ? this.pageIndex - 3 : 1;
    this.pageEnd = this.pageStart + 6 > this.pageCount ? this.pageCount : this.pageStart + 6;
  }
}
module.exports = PageList;
